<?php
function ListReview($type)
{
    global $dbsql,$language;
    
    $sql_where  = "from tblreview where cLanguage='$language'";
    if(!empty($type))
    {
        $sql_where .=" and cType='$type'";
    }
    
    $sql_select = "select count(iId) as count ".$sql_where;
    $result     = $dbsql->query_fetch($sql_select);
    $countall   = $result['count'];
    list($lf,$la)= Slit_Page($countall);
    
    $sql_select = "select * ".$sql_where." order by iId desc limit $lf,$la";
    return $dbsql->load($sql_select);
}

function NameParentById($idP,$type)
{
    global $dbsql,$language;
    
    if(empty($type) || intval($idP)==0)
    {
        return;
    }
    
    $sql_select = "select cName from ";
    if($type=="tour")
    {
        $sql_select.= ' tblsettour ';
    }else
    {
        $sql_select.= ' tblhotel ';
    }
    $sql_select .= " where iId = '$idP' and cLanguage='$language'";
    $result      = $dbsql->query_fetch($sql_select);
    return $result['cName'];
}
?>